#ifndef _U_BROADCAST_B1_H
#define _U_BROADCAST_B1_H

#include "uBroadcast.h"

typedef struct _ub_B1 {
	int serialPort;
} ub_B1;

/**
 * Connect to serial sniffer.
 * @return connection structure pointer.
 * Use ub_b1_disconnect to free memory.
 */
ub_B1 * ub_b1_connect(char * device);

/**
 * Disconnect from uBroadcast.
 * Close UDP socket.
 */
void ub_b1_disconnect(ub_B1 * conn);

/**
 * Send message to uBroadcast
 */
void ub_b1_send(ub_B1 * conn, uMessage * msg);

/**
 * Wait for message from uBroadcast.
 * This method is blocking.
 * @return 0 on success, other on error.
 */
int ub_b1_recv(ub_B1 * conn, uMessage * msg);

#endif
